﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VkontakteSharp.Model
{
    /// <summary>
    /// Типичный ответ 3.0 версии API
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class Response<T>
    {
        [JsonMapping("response", JsonMapping.MappingType.Collection)]
        public T Data { get; set; }

        [JsonMapping("error", JsonMapping.MappingType.Class)]
        public VkError Error { get; set; }
    }

    public class ResponseClass<T>
    {
        //06.2013 changed from Collection to Class
        [JsonMapping("response", JsonMapping.MappingType.Class)]
        public T Data { get; set; }

        [JsonMapping("error", JsonMapping.MappingType.Class)]
        public VkError Error { get; set; }
    }

    /// <summary>
    /// Специальный ответ для 5 и  выше версий API
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class Response5<T>
    {
        /// <summary>
        /// </summary>
        [JsonMapping("count", JsonMapping.MappingType.Primitive)]
        public int Count { get; set; }

        /// <summary>
        /// </summary>
        [JsonMapping("total_count", JsonMapping.MappingType.Primitive)]
        public int Total { get; set; }

        /// <summary>
        /// </summary>
        [JsonMapping("next_from", JsonMapping.MappingType.Primitive)]
        public string Next { get; set; }

        /// <summary>
        /// </summary>
        [JsonMapping("items", JsonMapping.MappingType.Collection)]
        public List<T> Items { get; set; }
    }

}
